Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <head> <style> #myDIV { position: absolute; width: 100px; height: 100px; background-color: coral; color: white; } </style> </head> <body> <p>Click the "Try it" button to position the DIV element -30 pixels from the left edge:</p> <p><strong>Note:</strong> If the position property is set to "static", the left property has no effect.</p> <button onclick="myFunction()">Try it</button> <div id="myDIV"> <h1>myDIV</h1> </div> <script> function myFunction() { document.getElementById("myDIV").style.left = "-30px"; } </script> </body> <!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_style_left2 by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:25:31 GMT --> </html>
Result:
Try it Yourself - © w3schools.com